package com.shujia.java.day2;

import java.util.Scanner;

public class Demo9Switch {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        System.out.println("请输入小明的名次：");
        int num = sc.nextInt();

        /*if (num == 1) {
            System.out.println("奖励一个笔记本电脑");
        } else if (num == 2) {
            System.out.println("奖励一个手机");
        } else if (num == 3) {
            System.out.println("奖励一个移动硬盘");
        } else {
            System.out.println("没有奖励");
        }*/

        switch (num) {
            case 1:
                System.out.println("奖励一个笔记本电脑");
                break;
            case 2:
                System.out.println("奖励一个手机");
                break;
            case 3:
                System.out.println("奖励一个移动硬盘");
                break;
            default:
                System.out.println("没有奖励");
                break;
        }





    }
}
